// 披萨类型
export type PizzaType = 'Margherita' | 'Pepperoni' | 'Vegetarian' | 'MeatLovers';

// 披萨配方
export type PizzaRecipeType = {
    name: PizzaType;
    ingredients: string[];
    bakeTime: number; // 秒
    value: number; // 金钱奖励
};

// 订单状态
export type OrderStatus = 'pending' | 'in-progress' | 'completed' | 'failed';

// 订单对象
export interface Order {
  id: string;
  pizzaType: PizzaType;
  status: OrderStatus;
  createdAt: number; // 时间戳
  timeLimit: number; // 秒
}

// 烤炉槽位状态
export type OvenSlotStatus = 'empty' | 'baking' | 'ready' | 'burnt';

// 烤炉槽位
export interface OvenSlot {
  id: number;
  status: OvenSlotStatus;
  pizza?: PizzaType;
  startTime?: number;
  remainingTime?: number;
}

// 游戏状态
export interface GameState {
  money: number;
  reputation: number; // 0-100
  orders: Order[];
  ovenSlots: OvenSlot[];
  currentOrderId?: string; // 当前选中的订单
  selectedIngredients: string[];
  gameActive: boolean;
  gameOver: boolean;
}

// 游戏上下文类型
export interface GameContextType {
  state: GameState;
  startGame: () => void;
  pauseGame: () => void;
  restartGame: () => void;
  selectOrder: (orderId: string) => void;
  selectIngredient: (ingredient: string) => void;
  resetSelectedIngredients: () => void;
  cookPizza: () => boolean;
  takePizzaFromOven: (slotId: number) => PizzaType | null;
  deliverPizza: (orderId: string, pizzaType: PizzaType) => boolean;
}